/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pnt.message;

import pnt.message.objects.*;

/**
 *
 * @author andrew
 */
public class Request_Deregister extends Request {


    User enduser;
    String applicationname;
    int instance;


    public Request_Deregister(int transactionNumber,
                    User enduser, 
                    String applicationName,
                    int instance) {
        super(transactionNumber, Request.RequestType.DEREGISTER);
        this.enduser = enduser;
        this.applicationname = applicationName;
        this.instance = instance;
    }
    
    @Override
    public String toString(String endChar, String term) {
        
        String s  = "DEREGISTER * PNT/1.0" + endChar +
                    "Transaction: " + getTransactionNumber() + endChar +
                    "End-User: " + enduser.toString() + endChar +
                    "Application: " + applicationname + endChar +
                    "Instance: " + instance + term;
             
        return s;
    }

    @Override
    public byte[] toBytes() {
        return toString().getBytes();
    }

	public User getEnduser() {
		return enduser;
	}

	public String getApplicationname() {
		return applicationname;
	}

	public int getInstance() {
		return instance;
	}


}
